﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OMDR
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            
            SelectProjectScreen locSelectProjectScreen = new SelectProjectScreen();
            this.frame1.Content = locSelectProjectScreen;

            List<String> locProjectList = new List<String>();
            TransactionManager locTransactionManager = TransactionManager.getInstance;
            locProjectList = locTransactionManager.getProjectListInDB();
            for (int i = 0; i < locProjectList.Count; i++)
            {
                locSelectProjectScreen.projectName.Items.Add(locProjectList[i]);
            }            
        }

        private void MenuItemQuit_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void MenuItemObjectif_Click(object sender, RoutedEventArgs e)
        {
            SpecificObjectifScreen locSpecificObjectifScreen = new SpecificObjectifScreen();
            this.frame1.Content = locSpecificObjectifScreen;
        }

        private void MenuItemRisk_Click(object sender, RoutedEventArgs e)
        {
            SpecificRiskScreen locSpecificRiskScreen = new SpecificRiskScreen();
            this.frame1.Content = locSpecificRiskScreen;
        }

        private void MenuItemPlan_Click(object sender, RoutedEventArgs e)
        {
            SpecificPlanScreen locSpecificPlanScreen = new SpecificPlanScreen();
            this.frame1.Content = locSpecificPlanScreen;
        }

        private void MenuItemAction_Click(object sender, RoutedEventArgs e)
        {
            SpecificActionScreen locSpecificActionScreen = new SpecificActionScreen();
            this.frame1.Content = locSpecificActionScreen;
        }

        private void MenuItemProblem_Click(object sender, RoutedEventArgs e)
        {
            SpecificProblemScreen locSpecificProblemScreen = new SpecificProblemScreen();
            this.frame1.Content = locSpecificProblemScreen;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ChooseDataScreen locChooseDataScreen = new ChooseDataScreen();
            this.frame1.Content = locChooseDataScreen;
        }
    }
}
